<?php 
$dbname = $_SESSION['database'];
pg_connect("host=localhost user=postgres password='password' dbname=$dbname") or die(ps_last_error());
?>
